/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package jamjun.infra.lang;

/**
 *
 * @author Java
 */
public class JJString{
    public static Boolean IsNullOrEmty(String data){
        if(data == null)
        {
            return true;
        }
        else if("".equals(data.trim())){
            return true;
        }else{
            return false;
        }
    }
    
    public static int SearchCount(String keySearch,String message){
        try{
            int lastIndex = 0;
            int count =0;
            while(lastIndex != -1){
                lastIndex = message.indexOf(keySearch,lastIndex);
                if( lastIndex != -1){
                    count ++;
                    lastIndex+=keySearch.length();
                }
            }
            return count;
        }catch(Exception ex){
            throw ex;
        }
    }
}
